function Block(x,y){ //BLOQUES PARA ROMPER
	this.x = x;
	this.y = y;
	this.w = 50;
	this.h = 25;
	this.puntos = 10;
	this.numParticulas = 200;
	this.started = true;
	this.audio = new Audio();
	this.audio.src = "http://www.lunerouge.org/sons/sf/LRLaser%20gun%2005%20by%20Lionel%20Allorge.ogg";
	this.audioWin = new Audio();
	this.audioWin.src = "http://www.lunerouge.org/sons/humain/LRApplauses%201%20by%20Lionel%20Allorge.ogg";
}

Block.prototype = {
	move: function() {			
		this.x += this.vx;
		this.y += this.vy;
	},
	
	deleteBlock : function(){
		var rand = Math.random()*10 ;
		var FRESA = 1, MANZANA = 2, ESTRELLA = 3;
		switch(Math.floor(rand)){
			case 1:
				items.push(new Item(this.x, this.y , FRESA));
			break;
					
			case 2:
				items.push(new Item(this.x, this.y , MANZANA));
			break;
			
			case 3:
				items.push(new Item(this.x, this.y , ESTRELLA));
			break;
		}
		for(var i=0;i<this.numParticulas;i++){
			particulas.push(new Particula(this.x + this.w/2, this.y , 1 , 10));
		}
		blocks.splice(blocks.indexOf(this),1);
		this.audio.play();

		if(blocks.length == 0){
			this.audioWin.play();
			levelComplet();
		}
		puntuacion = puntuacion + this.puntos;	
	},
}